package debby.com.lifecycle.util

import android.graphics.drawable.GradientDrawable

/**
 * Created by debby on 2019/1/30.
 * 描述:
 */

fun getRoundShape(radius: Float, color: Int): GradientDrawable {
    val gradientDrawable = GradientDrawable()
    gradientDrawable.shape = GradientDrawable.RECTANGLE

    gradientDrawable.cornerRadius = radius
    gradientDrawable.setColor(color)

    return gradientDrawable
}

fun getRoundCornerShape(radius: Float, color: Int): GradientDrawable {
    val gradientDrawable = GradientDrawable()
    gradientDrawable.shape = GradientDrawable.RECTANGLE

    gradientDrawable.cornerRadius = radius
    gradientDrawable.setStroke(4, color)
    return gradientDrawable
}